﻿namespace Smart.Utils.Net
{
    using System;

    public class DownloadEventArgs : EventArgs
    {
        private long currentFileSize;
        private string downloadState;
        private int percentDone;
        private long totalFileSize;

        public DownloadEventArgs(string state)
        {
            this.downloadState = state;
        }

        public DownloadEventArgs(int percentDone, string state)
        {
            this.percentDone = percentDone;
            this.downloadState = state;
        }

        public DownloadEventArgs(long totalFileSize, long currentFileSize)
        {
            this.totalFileSize = totalFileSize;
            this.currentFileSize = currentFileSize;
            this.percentDone = (int) ((((double) currentFileSize) / ((double) totalFileSize)) * 100.0);
        }

        public long CurrentFileSize
        {
            get
            {
                return this.currentFileSize;
            }
            set
            {
                this.currentFileSize = value;
            }
        }

        public string DownloadState
        {
            get
            {
                return this.downloadState;
            }
        }

        public int PercentDone
        {
            get
            {
                return this.percentDone;
            }
        }

        public long TotalFileSize
        {
            get
            {
                return this.totalFileSize;
            }
            set
            {
                this.totalFileSize = value;
            }
        }
    }
}

